﻿namespace MemoryTest_Communications.PropertySearch.Resources
{
    using System.Collections.Generic;
    using System.Xml.Serialization;
    using Newtonsoft.Json;

    [JsonObject(MemberSerialization.OptIn)]
    [XmlTypeAttribute(TypeName = "metadata")]
    public sealed class Metadata
    {
        public Metadata()
        {
            Data = new List<Data>();
        }

        [JsonProperty("currency")]
        [XmlAttribute(AttributeName = "currency", Type = typeof(string))]
        public string PriceCurrency { get; set; }

        [JsonProperty("data")]
        [XmlArray(ElementName = "data")]
        public IList<Data> Data { get; set; }

        [JsonProperty("listing_type")]
        [XmlAttribute(AttributeName = "listing_type", Type = typeof(string))]
        public string ListingType { get; set; }

        [JsonProperty("metadata_name")]
        [XmlAttribute(AttributeName = "metadata_name", Type = typeof(string))]
        public string Name { get; set; }

        [JsonProperty("num_beds")]
        [XmlAttribute(AttributeName = "num_beds", Type = typeof(string))]
        public string BedroomCount { get; set; }

        [JsonProperty("price_type")]
        [XmlAttribute(AttributeName = "price_type", Type = typeof(string))]
        public string PriceType { get; set; }

        [JsonProperty("property_type")]
        [XmlAttribute(AttributeName = "property_type", Type = typeof(string))]
        public string PropertyType { get; set; }

        [JsonProperty("url")]
        [XmlAttribute(AttributeName = "url", Type = typeof(string))]
        public string Url { get; set; }
    }
}
